package com.teamsun.rptcfg;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 报表信息基础类
 */
public class BaseRpt implements Serializable{

    /**
     * 报表ID
     */
    private int rptId;

    /**
     * 报表名称
     */
    private String rptName;

    /**
     * 对于某些报表只开放给指定的系统，这时报表工具会提供token给相关的系统
     * 在访问报表时会验证系统传给报表工具的token,如果验证通过则允许访问
     */
    private String rptToken;

    /**
     * 报表接入系统代码
     */
    private String accessSysCode;

    /**
     * 报表表头(JSON字符串)
     */
    private String rptHeader;

    /**
     * 报表Excel表头信息(按照Excel表头的时间顺序存储)
     * 对于复杂表头JSON字符串拼接的表头顺序和Excel文件中的表头顺序不符，会导致导出报表时列信息错误
     * 所有需要额外保存Excel表头顺序
     */
    private List<String> excelHeader;

    /**
     * 报表冻结表头(JSON字符串)
     */
    private String rptLockHeader;

    /**
     * 报表所属数据源
     */
    private String dataSource;

    /**
     * 报表中包含的所有显示的列信息
     */
    private List<BaseRptColumn> rptColumns;

    /**
     * 报表中包含的隐藏列信息(该隐藏列在Excel表头中不存在,该配置通常用于拼接SQL时作为查询条件列)
     */
    private List<BaseRptColumn> hiddenRptColumns;

    /**
     * 报表中的冻结列信息
     */
    private List<BaseRptColumn> lockColumns;

    /**
     * 报表中的查询列信息
     */
    private List<BaseRptColumn> conditionColumns;

    /**
     * 报表中的汇总列
     */
    private List<BaseRptColumn> sumColumns;

    /**
     * 报表查询的表信息
     */
    private String fromInfo;

    /**
     * 报表查询中嵌套查询SQL
     */
    private NestFrom nestFrom;

    /**
     * having过滤条件
     */
    private Map<String, Having> having;

    /**
     * 报表是否需要汇总 0:不汇总  1:汇总
     */
    private String needSum;

    /**
     * 默认是否可以分组(该属性无需配置)
     * 当SQL中使用rollup()函数时，SQL查询结果含有汇总数据
     * 此时需要将报表设置为默认汇总，且不影响needSum的配置
     */
    private String defaultSum;

    /**
     * 是否有查询按钮  0:没有 1:有
     * 当报表没有查询条件时，某些情况下不需要显示查询按钮
     */
    private String needQuery;

    /**
     * 报表是否分页 0:不分页  1:分页
     */
    private String needPage;

    /**
     * 报表是否需要导出
     */
    private String needImport;

    /**
     * 是否需要离线下载
     */
    private String needOffLine;

    /**
     * 报表展示页面是否有左侧分析菜单
     */
    private String needAnalysis;

    /**
     * 下钻时下钻页面的打开方式，0-下钻在新窗口打开 1-下钻在当前页面展示
     */
    private String drillLayout;

    /**
     * 报表初始排序信息
     */
    private String orderInfo;

    /**
     * 报表是否有自定义报表功能
     */
    private String selfDefine;

    /**
     * 指标卡
     */
    private String idxCard;

    /**
     * 配置group by
     */
    //private String groupInfo;

    /**
     * 默认查询条件
     */
    //private String defaultWhere;

    /**
     * 默认查询条件
     */
    private Map<String, DefaultWhere> defaultWhere;

    /**
     * 默认分组
     */
    private Map<String, DefaultGroup> defaultGroup;

    /**
     * 报表页面展示风格
     */
    private String rptStyle;

    /**
     * 报表配置文件模板类型
     */
    private String xmlTemplate;

    /**
     * 报表查询类型
     */
    private String tmplateType;

    /**
     * 第三方系统传入报表工具的参数
     */
    private String thirdParam;

    /**
     * 报表初始化查询参数
     */
    private String initCondition;

    /**
     * 是否隐藏查询条件(0-不隐藏 1-隐藏)
     */
    private String isHideCondition;

    /**
     * 数字动态格式化列信息
     */
    private BaseRptColumn dynamicNum;

    /**
     * 日期动态格式化列信息
     */
    private BaseRptColumn dynamicDate;

    /**
     * 报表创建人
     */
    private String createUser;

    /**
     * 报表是否是全都是指标
     * 有些报表仅需要控制列的动态展示，无需动态group by
     * 这种情况下需要将报表的所有列都设置为指标
     * 1-全部都是指标列  0-同时包含指标列和维度列
     */
    private String allIdx;

    private boolean resetHeader;

    public String getNeedOffLine() {
        return needOffLine;
    }

    public void setNeedOffLine(String needOffLine) {
        this.needOffLine = needOffLine;
    }

    public String getAccessSysCode() {
        return accessSysCode;
    }

    public void setAccessSysCode(String accessSysCode) {
        this.accessSysCode = accessSysCode;
    }

    public int getRptId() {
        return rptId;
    }

    public void setRptId(int rptId) {
        this.rptId = rptId;
    }

    public String getRptName() {
        return rptName;
    }

    public void setRptName(String rptName) {
        this.rptName = rptName;
    }

    public List<BaseRptColumn> getRptColumns() {
        return rptColumns;
    }

    public void setRptColumns(List<BaseRptColumn> rptColumns) {
        this.rptColumns = rptColumns;
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public String getFromInfo() {
        return fromInfo;
    }

    public void setFromInfo(String fromInfo) {
        this.fromInfo = fromInfo;
    }

    public String getRptHeader() {
        return rptHeader;
    }

    public void setRptHeader(String rptHeader) {
        this.rptHeader = rptHeader;
    }

    public String getNeedSum() {
        return needSum;
    }

    public void setNeedSum(String needSum) {
        this.needSum = needSum;
    }

    public String getDefaultSum() {
        return defaultSum;
    }

    public void setDefaultSum(String defaultSum) {
        this.defaultSum = defaultSum;
    }

    public String getOrderInfo() {
        return orderInfo;
    }

    public void setOrderInfo(String orderInfo) {
        this.orderInfo = orderInfo;
    }

    public String getRptStyle() {
        return rptStyle;
    }

    public void setRptStyle(String rptStyle) {
        this.rptStyle = rptStyle;
    }

    public String getNeedPage() {
        return needPage;
    }

    public void setNeedPage(String needPage) {
        this.needPage = needPage;
    }

    public String getNeedImport() {
        return needImport;
    }

    public void setNeedImport(String needImport) {
        this.needImport = needImport;
    }

    public String getTmplateType() {
        return tmplateType;
    }

    public void setTmplateType(String tmplateType) {
        this.tmplateType = tmplateType;
    }

    public List<BaseRptColumn> getLockColumns() {
        return lockColumns;
    }

    public void setLockColumns(List<BaseRptColumn> lockColumns) {
        this.lockColumns = lockColumns;
    }

    public List<BaseRptColumn> getConditionColumns() {
        return conditionColumns;
    }

    public void setConditionColumns(List<BaseRptColumn> conditionColumns) {
        this.conditionColumns = conditionColumns;
    }

    public List<BaseRptColumn> getSumColumns() {
        return sumColumns;
    }

    public void setSumColumns(List<BaseRptColumn> sumColumns) {
        this.sumColumns = sumColumns;
    }

    public String getRptLockHeader() {
        return rptLockHeader;
    }

    public void setRptLockHeader(String rptLockHeader) {
        this.rptLockHeader = rptLockHeader;
    }

    public String getXmlTemplate() {
        return xmlTemplate;
    }

    public void setXmlTemplate(String xmlTemplate) {
        this.xmlTemplate = xmlTemplate;
    }

    public List<BaseRptColumn> getHiddenRptColumns() {
        return hiddenRptColumns;
    }

    public void setHiddenRptColumns(List<BaseRptColumn> hiddenRptColumns) {
        this.hiddenRptColumns = hiddenRptColumns;
    }

    public String getThirdParam() {
        return thirdParam;
    }

    public void setThirdParam(String thirdParam) {
        this.thirdParam = thirdParam;
    }

    public String getNeedAnalysis() {
        return needAnalysis;
    }

    public void setNeedAnalysis(String needAnalysis) {
        this.needAnalysis = needAnalysis;
    }

    public String getInitCondition() {
        return initCondition;
    }

    public void setInitCondition(String initCondition) {
        this.initCondition = initCondition;
    }

    public Map<String, DefaultGroup> getDefaultGroup() {
        return defaultGroup;
    }

    public void setDefaultGroup(Map<String, DefaultGroup> defaultGroup) {
        this.defaultGroup = defaultGroup;
    }

    public Map<String, DefaultWhere> getDefaultWhere() {
        return defaultWhere;
    }

    public void setDefaultWhere(Map<String, DefaultWhere> defaultWhere) {
        this.defaultWhere = defaultWhere;
    }

    public NestFrom getNestFrom() {
        return nestFrom;
    }

    public void setNestFrom(NestFrom nestFrom) {
        this.nestFrom = nestFrom;
    }

    public String getIsHideCondition() {
        return isHideCondition;
    }

    public void setIsHideCondition(String isHideCondition) {
        this.isHideCondition = isHideCondition;
    }

    public String getRptToken() {
        return rptToken;
    }

    public void setRptToken(String rptToken) {
        this.rptToken = rptToken;
    }

    public String getDrillLayout() {
        return drillLayout;
    }

    public void setDrillLayout(String drillLayout) {
        this.drillLayout = drillLayout;
    }

    public List<String> getExcelHeader() {
        return excelHeader;
    }

    public void setExcelHeader(List<String> excelHeader) {
        this.excelHeader = excelHeader;
    }

    public BaseRptColumn getDynamicNum() {
        return dynamicNum;
    }

    public void setDynamicNum(BaseRptColumn dynamicNum) {
        this.dynamicNum = dynamicNum;
    }

    public BaseRptColumn getDynamicDate() {
        return dynamicDate;
    }

    public void setDynamicDate(BaseRptColumn dynamicDate) {
        this.dynamicDate = dynamicDate;
    }

    public String getSelfDefine() {
        return selfDefine;
    }

    public void setSelfDefine(String selfDefine) {
        this.selfDefine = selfDefine;
    }

    public String getIdxCard() {
        return idxCard;
    }

    public void setIdxCard(String idxCard) {
        this.idxCard = idxCard;
    }

    public Map<String, Having> getHaving() {
        return having;
    }

    public void setHaving(Map<String, Having> having) {
        this.having = having;
    }

    public String getAllIdx() {
        return allIdx;
    }

    public void setAllIdx(String allIdx) {
        this.allIdx = allIdx;
    }

    public String getNeedQuery() {
        return needQuery;
    }

    public void setNeedQuery(String needQuery) {
        this.needQuery = needQuery;
    }

    public boolean getResetHeader() {
        return resetHeader;
    }

    public void setResetHeader(boolean resetHeader) {
        this.resetHeader = resetHeader;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
}
